<extend name="Public/base" />
<block name="body">
    <div class="main-title" style="padding-bottom: 10px;">
        <h2>销售单据</h2>
    </div>
    <div class="cf">
        <div class="fl ">
            
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <form action="{:U('SpOrder/index')}" method='post' id="form-search">
                  <select name="shopId" class="search-input" >
                        <option value='-1'>全部门店</option> 
                        <volist name='shoplist' id='vo'>
                                  <option value='{$vo.id}' <eq name='shopId' value='$vo.id'>selected="selected"</eq>>{$vo.name}</option>                      
                        </volist>
                    </select>
                    <input type="text" name="b_date" class="text input-large time search-input " value="{:I('b_date')}" placeholder="请选择开始时间"   style="height: 30px;width:160px" />
                 
                
                    <input type="text" name="e_date" class="text input-large time search-input "  value="{:I('e_date')}" placeholder="请选择结束时间"   style="height: 30px;width:160px" />
           
                    <input type="text" name="name" class="search-input hidden" value="{:I('name')}" placeholder="请输入商品名称">
                    <a class="sch-btn" href="javascript:;" id="search" url="#"><i class="btn-search" id="submit"></i></a>

                </form>
            </div>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table>
            <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>  
                    <th>门店</th>
                    <th>订单编号</th>
                    <th>日期</th>
                    <th>类型</th>
                    <th>收银员</th>
                    <th>会员卡</th>                    
                    <th>商品数量</th> 
                    <th>商品原价</th>
                    <th>实收金额</th>
                    <th>支付方式</th>
                    <th>利润</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
                        <td>{$vo.shopId|get_sp_shop_name}</td>
                        <td>{$vo.orderNum} </td> 
                        <td>{$vo.createat|time_format}</td>
                        <td><eq name="vo.type" value="1">销售<else/>充值</eq></td>
                        <td>{$vo.shopStaffId|get_nickname}</td> 
                        <td>{$vo.memberId|get_sp_membercard_cardNum}</td>
                        <td>{$vo.productCount}</td>
                        <td>{$vo.originPrice}</td> 
                        <td>{$vo.finnalPrice}</td>
                        <td>{$vo.payTypeId|get_sp_payway_name}</td> 
                        <td>{$vo.profit}</td>   
                        <td><a href="{:U('detail')}&id={$vo.orderNum}" class="btn btn-primary">详情</a></td>
                    </tr>
                </volist>
                <else/>
                <td colspan="12" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div> 
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
      <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

    <script type="text/javascript">
        //搜索查询
        $('#submit').click(function () { 
            document.getElementById("form-search").submit()
        }); 
          $(function () {
            $('.time').datetimepicker({
                //format: 'yyyy-mm-dd hh:ii',
                format: 'yyyy-mm-dd hh:ii:ss',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });
        });

        //导航高亮
        highlight_subnav('{:U('SpOrder/index')}');
    </script>
</block>